package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.business.emergencyCommand;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.business.emergencyCommand.EmergencyCommandService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * @Author: YangYu
 * @ClassName: EmergencyCommandController
 * @Date: Created in 13:37 2024/4/27
 * @Description: 应急指挥
 */
@Action
@RequestMapping(value="emergencyCommand")
public class EmergencyCommandController extends BaseController {

    @Resource
    private EmergencyCommandService emergencyCommandService;


    /**
     * @Author YangYu
     * @Description 应急指挥信息新增、编辑
     * @Date Created in 13:38 2024/4/27
     * @Param [jsonParam]
     */

    @At(value = "emergencyCommandAddOrUpdate", method = RequestMethod.POST)
    public RespEntity emergencyCommandAddOrUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return emergencyCommandService.emergencyCommandAddOrUpdate(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 应急指挥信息删除
     * @Date Created in 13:38 2024/4/27
     * @Param [jsonParam]
     */

    @At(value = "emergencyCommandDel", method = RequestMethod.POST)
    public RespEntity emergencyCommandDel(@RequestBody(required = false) JSONObject jsonParam) {
        return emergencyCommandService.emergencyCommandDel(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 应急指挥信息分页列表
     * @Date Created in 13:38 2024/4/27
     * @Param [jsonParam]
     */

    @At(value = "emergencyCommandListPage", method = RequestMethod.GET)
    public RespEntity emergencyCommandListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return emergencyCommandService.emergencyCommandListPage(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 应急保障情况（数量）
     * @Date Created in 13:38 2024/4/27
     * @Param [jsonParam]
     */

    @At(value = "emergencyCommandCount", method = RequestMethod.GET)
    public RespEntity emergencyCommandCount(@RequestBody(required = false) JSONObject jsonParam) {
        return emergencyCommandService.emergencyCommandCount(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 应急指挥信息列表
     * @Date Created in 13:38 2024/4/27
     * @Param [jsonParam]
     */

    @At(value = "emergencyCommandList", method = RequestMethod.GET)
    public RespEntity emergencyCommandList(@RequestBody(required = false) JSONObject jsonParam) {
        return emergencyCommandService.emergencyCommandList(jsonParam);
    }

}
